package hoodoos.rule.core;


import hoodoos.rule.api.Facts;
import hoodoos.rule.api.GlobalContext;
import hoodoos.rule.api.RequestContext;
import hoodoos.rule.api.Rule;
import java.util.Objects;


public class BasicRule implements Rule {


  protected String name;

  public BasicRule(final String name) {
    this.name = name;
  }

  @Override
  public String getName() {
    return name;
  }

  @Override
  public boolean evaluate(GlobalContext globalContext, RequestContext requestContext) {
    return false;
  }

  @Override
  public void execute(GlobalContext globalContext, RequestContext requestContext, Facts facts) throws Exception {

  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    BasicRule basicRule = (BasicRule) o;
    return name.equals(basicRule.name);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name);
  }
}
